package com.macllvm.whale.entity;

import java.util.List;
import java.util.LinkedList;
import java.util.concurrent.atomic.AtomicInteger;

public class Buddy{
    public  static final int STATE_ONLINE = 0;
    public  static final int STATE_OFFLINE = 1;
     
    private String  ip;
    private String  userName;
    private String  hostName;
    private String  nickName;
    private String  avatar;
    private String  signature;
    private int        state;
    private AtomicInteger unreadCount = new AtomicInteger(0);

    public Buddy(){

    }

    public Buddy(String ip, String userName, String hostName, String nickName,
                            String avatar,  String signature, int state ) {
        this.ip = ip;
        this.userName = userName;
        this.hostName = hostName;
        this.nickName = nickName;
        this.avatar = avatar;
        this.signature = signature;
        this.state = state;
    }

    public String  getIP(){
        return  ip;
    }

    public void setIP(String ip){
        this.ip = ip; 
    }

    public String  getUserName(){
         return   userName;
    }

    public void  setUserName(String userName){
         this.userName = userName;  
    }

    public String  getHostName(){
         return   hostName; 
    }

    public void  setHostName(String hostName){
         this.hostName = hostName; 
    }

    public String  getNickName(){
         return   nickName; 
    }

    public void  setNickName(String nickName){
         this.nickName = nickName; 
    }

    public String getSignature(){
         return signature;
    }

    public void setSignature(String sign){
         this.signature = sign;
    }

    public int getState(){
         return state;   
    } 

    public void setState(int state){
         this.state = state;   
    }     

    public void increateUnreadCount() {
        unreadCount.addAndGet(1);
    }

    public void resetUnreadCount() {
        unreadCount.set(0);
    }

    public int getUnreadCount() {
        return unreadCount.get();
    }
} 
